
/**
 * This class is edge class which
 * make a edge out of two vertices
 * @author ldong
 *
 */
public class Edge {
	
	private Vertex a;
	private Vertex b;
	private int weight;
	
	/**
	 * Constructor which takes two vertices and their weight
	 * @param a
	 * @param b
	 * @param weight
	 */
	public Edge(Vertex a, Vertex b, int weight)
	{
		this.a = a;
		this.b = b; 
		this.weight = weight;
	}
	
	/**
	 * overriding toString method
	 */
	public String toString()
	{
		return b.getName()+ "<->" + a.getName() + "  "+weight+ "\n";
	}

	/*
	 * Setters and getters	 
	 */
	
	public Vertex getA() {
		return a;
	}

	public void setA(Vertex a) {
		this.a = a;
	}

	public Vertex getB() {
		return b;
	}

	public void setB(Vertex b) {
		this.b = b;
	}

	public int getWeight() {
		return weight;
	}

	public void setWeight(int weight) {
		this.weight = weight;
	}

}
